package com.guoguo.utils.aliOss;

import com.guoguo.enums.AliOssImageEnum;
import com.guoguo.utils.aliOss.operation.*;

/**
 * Created by Administrator on 2017/9/18 0018.
 */

     /*
                           _ooOoo_
                          o8888888o
                          88" . "88
                          (| -_- |)
                          O\  =  /O
                       ____/`---'\____
                     .'  \\|     |//  `.
                    /  \\|||  :  |||//  \
                   /  _||||| -:- |||||-  \
                   |   | \\\  -  /// |   |
                   | \_|  ''\---/''  |   |
                   \  .-\__  `-`  ___/-. /
                 ___`. .'  /--.--\  `. . __
              ."" '<  `.___\_<|>_/___.'  >'"".
             | | :  `- \`.;`\ _ /`;.`/ - ` : | |
             \  \ `-.   \_ __\ /__ _/   .-` /  /
        ======`-.____`-.___\_____/___.-`____.-'======
                           `=---='
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 佛祖保佑       永无BUG
        */
public class AliOssImageFactory {

    public static AbstractAliOssImage createAliOssImage(AliOssImageConfig aliOssImageConfig) {
        if (aliOssImageConfig.getHandleType() == AliOssImageEnum.ALI_HANDLE_RESIZE.getId()) {
            return new AliOssImageResize();
        }
        if (aliOssImageConfig.getHandleType() == AliOssImageEnum.ALI_HANDLE_SYTLE.getId()) {
            return new AliOssImageStyle();
        }
        if (aliOssImageConfig.getHandleType() == AliOssImageEnum.ALI_HANDLE_ROTATE.getId()) {
            return new AliOssImageRotate();
        }
        if (aliOssImageConfig.getHandleType() == AliOssImageEnum.ALI_HANDLE_FORMAT.getId()) {
            return new AliOssImageFormat();
        }
        if (aliOssImageConfig.getHandleType() == AliOssImageEnum.ALI_HANDLE_WATERMARK.getId()) {
            return new AliOssImageWatermark();
        }
        return null;
    }
}
